package com.imooc.springcloud;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author caryguan
 * @version V1.0
 * @Package com.imooc.springcloud
 * @date 2020/10/21 14:07
 */

@FeignClient("feign-client")
//这里要注意,如果服务方不引入feign,可以打两个包,一个对接springCloud,一个对接springboot,不引入feign的只需要接口自己去实现就可以,注解都能删了
public interface IService {
    @GetMapping("/sayHi")
    public String sayHi();

    @PostMapping("/sayHi")
    public Friend sayHiPost(@RequestBody Friend friend);


    @GetMapping("/retry")
    public String retry(@RequestParam(name="timeout") int timeout);
}
